bool HasRing() const { return ring; }
        bool HasJewel() const { return jewel; }
 
+       std::vector<const Spell *> &Spells() { return spells; }
        const std::vector<const Spell *> &Spells() const { return spells; }
 
        graphics::Sprite *BattleSprite() { return battleSprite; }
 
 }
 
 
+bool Spell::Less(const Spell *lhs, const Spell *rhs) {
+       // TODO: find out real spell sorting order
+       return lhs->Cost() < rhs->Cost();
+}
+
+
 void Spell::CreateTypeDescription() {
        Spell s;
 
 
        HeroGroup &UsableBy() { return usableBy; }
        const HeroGroup &UsableBy() const { return usableBy; }
 
+       static bool Less(const Spell *, const Spell *);
+
 // temporary setters
 public:
        void SetName(const char *n) { name = n; }
 
 #include "../graphics/Font.h"
 #include "../graphics/Frame.h"
 
+#include <algorithm>
 #include <SDL.h>
 #include <vector>
 
        return *parent->Game().state->party[cursor];
 }
 
+Hero &SpellMenu::GetHero() {
+       return *parent->Game().state->party[cursor];
+}
+
 void SpellMenu::OnExitState(SDL_Surface *) {
        SDL_FreeSurface(highlight);
 }
        if (input.JustPressed(Input::ACTION_A)) {
                if (actionMenu.IsActive()) {
                        if (actionMenu.Selected() == CHOICE_SORT) {
-                               // TODO: sort spells
+                               std::sort(GetHero().Spells().begin(),
+                                               GetHero().Spells().end(),
+                                               Spell::Less);
                                LoadSpells();
                        } else {
                                actionMenu.SetSelected();
 
 
        virtual void OnResize(int width, int height);
 
+       common::Hero &GetHero();
        const common::Hero &GetHero() const;
 
        void LoadSpells();