most of the code is finished