fixed extends issue, enhanced formatting