cleaned up formatting and added console outputs