Cleaned backend custom query up and made consise,
Also updated comments to be accurate