obtain info about number of tasks before allocating memory
cleaned code + remmapped address