made loop peeling + caching in main method
seperated loop peeling from caching:
comment changed