made additional stylistic changes and added tracking code