some test and logic improvements, todos done