fixed Djs page

defined the while loops better