everything works know. rearranged scan-method