Why 1024? If this is related to the 512 before turn it into a constant or function.