en passant working
refactored some code