Added draft of optimized + corrected weight calc