fixing mistakes, cleanup