Indentation looks a bit messy. might need tweaking to increase readability.