fix mistakes, make it work