added more hints
removed redundant code