Fix creating the results directory if it does not exist. Create full path.
Fix when asking for last possible index
Added background and square positions