Made necessary changes to compile with crayftn.