Sorted content max height issues, cleaned up javascript file