Removed unused functions, declared some defines, global GPoint.