single (de)allocations of memory

now memory for frames is allocated once in main.
and also free once at the end.
removed all the warnings

also improved the makefile