adding very basic version of calculating rows as per db/table