added time option, changed some formatting, debugging