got all the basic logic done