Actually working and simplified code