Update 4

Fixed some thigns and simplified code.