Modifications to make it work with xCode