code re-formatted