Edited with structure pointers.