Cleaned up semi-working