updated code so it looks nicer on the blog