Removed compile errors. needs testing