Changed data type for the frames (to make it compatible for 64 bit architecture) NOT TESTED