fixing function and styling