Code basically working