Implemented the rectangle packing algorithm in F# (performance and prettier code)