added controller and changed level storage method