Fixed bugs and added user functionality