cleanup, fixes, completion of the first step