Added sprite writing