added free space functionality