Added comments and some formatting changes as per Trooper format