Fixed bugs and added new stuff