implemented scanner
fixed merge issues