All functions now working