Improved arrange (cols/rows calculated by actual width/height)

Fixed overlapping programs/gaps