Recoded to be compliled on external server hosting