adjusted style and some code to match