added andand pattern
split up better, moved tests into directory