Added documentation on higher level logic