Hopefully proper code this time