replaced the order of post population to be done after the LIMIT in order to reduce the amount of work.