Improve functionality and add media queries