Cleaned up spacing and added sanity check