Changed package structure. Fixed logic of counting.