Fixed errors and adjusted formatting