Improved speed by removing multiplication function