Changed some formatting and short-circuiting