Reprogrammed with better memory management

Instead of making a list and appending the capitalized words to it and
returning it when whole file is processed (which usually takes more
memory and longer time) it now outputs faster as script have no longer
to wait for whole file to be processed.