nicer implementation with correct syntax :)