cleaned up code added format