rearranged some code, added time and print features