Fix bugs, simplified code
Updates