Seperated out Ang's code