drastically simplified code