Changed a few things around for compadability